<template>
  <van-sku
    v-model="show"
    :sku="sku"
    :goods="goods"
    :goods-id="goodsId"
    :quota="quota"
    :quota-used="quotaUsed"
    :hide-stock="sku.hide_stock"
    :message-config="messageConfig"
  />
</template>
<script>
import Vue from "vue";
import { Sku } from "vant";
Vue.use(Sku);
export default {
  props: {
    type: Object,
    default() {
      return {};
    }
  },
  data() {
    return {
      show: false,
      sku: {
        // 数据结构见下方文档
      },
      goods: {
        // 数据结构见下方文档
      }
    };
  },
  created() {
    this.buildSkuTree();
  },
  methods: {
    buildSkuTree() {
      this.goods.specificationList.map((item, index) => {
        var v = item.valueList.map((value, index) =>({
            id: value.id,
            name: value.name
        })
        )
        return {
          k: item.name,
          k_s: "s" + (index + 1),
          v
        }
    })
  }
  }
};
</script>